<?php
/* @var $this CompanyBlacklistController */
/* @var $model CompanyBlacklist */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'company-blacklist-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><span class="required">*</span> 是必填内容.</p> 

	<?php //echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>

	<div class="row">
        <?php echo $form->labelEx($model,'mobile'); ?>
        <?php echo $form->textField($model,'mobile',array('size'=>16,'maxlength'=>16)); ?>
        <?php echo $form->error($model,'mobile'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model,'mac'); ?>
        <?php echo $form->textField($model,'mac'); ?>
        <?php echo $form->error($model,'mac'); ?>
    </div>
    <div class="row">
		<?php if(Yii::app()->user->name=='admin'){?>  
			<?php echo $form->labelEx($model,'companyid'); ?>
			<?php echo $form->dropDownList(
	              $model,
	              'companyid', 
	            CHtml::listData(
	                Company::model()->findAll(),
	                'id',
	                'title'
	            )
	        ); ?> 
		
		<?php }else{
			 echo $form->hiddenField($model,'companyid',array('value'=>Yii::app()->user->id));
		}?>
	</div>
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '新增' : '保存',array('class'=>'subButton')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->